Post

Replies

Boosts

Views

Activity

SwiftuI view Error
Hi Im copying the Apple tutorial project for lists and navigation for SWiftUI but Im getting an error although my code is same as Apple project, can some one check please. Error "Cannot find 'landmarks' in scope" Kindest Regards import SwiftUI struct LandmarkRow: View {     var landmark: Landmark     var body: some View {         HStack {             Text(landmark.name)         }     } } struct LandmarkRow_Previews: PreviewProvider {     static var previews: some View {         LandmarkRow(landmark: landmarks[0])     } } import Foundation import SwiftUI import CoreLocation struct Landmark: Hashable, Codable {     var id: Int     var name: String     var park: String     var state: String     var description: String          private var imageName: String     var image: Image {         Image(imageName)     }          private var coordinates: Coordinates          var locationCoordinate: CLLocationCoordinate2D {         CLLocationCoordinate2D (             latitude: coordinates.latitude,             longitude: coordinates.longitude)     }          struct Coordinates: Hashable, Codable {         var latitude: Double         var longitude: Double     }      }
2
0
877
Mar ’21
Sturct View
Hi When creating new SwiftUI App we get the struct below in the ContentView.Swift file, but as I know sturct can't inherit or I missed something here ? and whats the word some means ? its not the struct name or the parent struct so whats its used for ? struct ContentView: view { ver body: some view { Text ( "Hello World" ) } }
2
0
430
Jul ’20
CloudKit Not Saving Records
Hi ..Im working on CloudKit, I made new iOS project and added a CloudKit Capability, as well as a container, imported it in a View Controller and tried to save data as code below, but nothing is happeing and no data is being saved when I go to the dashboard ?@IBAction func addReport(_ sender: Any) { let bugReport = CKRecord(recordType: "NewReport") bugReport ["BugName"] = "Bug 1" bugReport ["BugDisc"] = "Its a main bug" let container = CKContainer.default() let database = container.publicCloudDatabase database.save(bugReport) {(savedRecords, error) in } }
23
0
8.4k
May ’20
Segues cross storyboards
HiI saw a strange sugeues I see first time, where the destination view controllers are like icons cause they are in another stody board, how this can be done in a story board not programatically same as in photo below ? and haw it can be done in code ?h ttps://www.dropbox.com/s/nvl857**3r6ijap/Screen%20Shot%202020-04-29%20at%2012.17.11%20AM.png?dl=0--Kindest Regards
7
0
574
Apr ’20
panGestureRecognizer
HiIn this quick demo the first line as I understand is enouch to change the image of file, why he needed to use the second line the one with CGPoint.zero ? it doesnt make sense to me ?--Kindest Regardsh ttps://www.youtube.com/watch?v=rnJxpuPyLNA
0
0
290
Apr ’20